package com.zzj.base;

/**
 * @enumName: ResultCodeEnum
 * @description:
 * @author: zzj
 * @date: 2022年6月30日23:07:29
 */
public enum ResultCodeEnum {

    SUCCESS(0, "操作成功"),
    ERROR(1, "操作失败"),

    TOKEN_INVALID(401, "Token无效"),
    REFRESH_TOKEN_INVALID(402, "refreshToken无效"),
    NO_LOGGED_IN(405, "未登录"),
    TOKEN_EXPIRED(410, "Token已过期"),
    REFRESH_TOKEN_EXPIRED(420, "refreshToken已过期"),
    UNAUTHORIZED(450, "未授权"),

    SERVER_INTERNAL_ERROR(500, "系统内部错误"),

    BIZ_ERROR(1000, "通用业务异常"),

    FILE_OUT_MAX(9000, "文件超出最大限制"),

    FILE_FORMAT_ERROR(9001, "文件格式不正确"),

    PARAM_ERROR(9050, "参数错误"),

    JSON_FORMAT_ERROR(9051, "Json解析异常"),

    SQL_ERROR(9052, "Sql解析异常"),

    NETWORK_TIMEOUT(9510, "网络超时"),

    UNKNOWN_INTERFACE(9520, "未知的接口"),

    REQ_MODE_NOT_SUPPORTED(9530, "请求方式不支持"),

    SYS_ERROR(9999, "系统异常");


    /**
     * 状态码
     */
    private final int code;

    /**
     * 状态信息
     */
    private final String msg;

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    ResultCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}